package cn.com.taiji.pos.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.github.dreamyoung.mprelation.EntityMapper;
import com.github.dreamyoung.mprelation.JoinColumn;
import com.github.dreamyoung.mprelation.ManyToOne;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * POS机信息
 * </p>
 *
 * @author
 * @since 2021-03-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SystemPosMachine implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId("ID")
    private String id;

    /**
     * POS机名称
     */
    @TableField("NAME")
    private String name;

    /**
     * POS机编码(2位)
     */
    @TableField("CODE")
    private String code;

    /**
     * POS机物理标识(唯一)
     */
    @TableField("PHYSICAL_CODE")
    private String physicalCode;

    /**
     * 所属餐厅
     */
    @TableField("RESTAURANT_ID")
    private String restaurantId;

    /**
     * 所属项目部
     */
    @TableField("PROJECT_ID")
    private String projectId;

    /**
     * 菜品介绍图(图片URL地址)
     */
    @TableField("URL")
    private String url;

    /**
     * 介绍图切换间隔时间(秒)
     */
    @TableField("INTERVAL_TIME")
    private Integer intervalTime;

    /**
     * 相关描述
     */
    @TableField("DESCRIPTION")
    private String description;

    /**
     * 状态(0:启用,1:停用)
     */
    @TableField("STATUS")
    private String status;

    /**
     * 创建人
     */
    @TableField("CREATOR_ID")
    private String creatorId;

    /**
     * 创建人姓名
     */
    @TableField("CREATOR_NAME")
    private String creatorName;

    /**
     * 创建时间
     */
    @TableField("CREATE_TIME")
    private LocalDateTime createTime;

    /**
     * 钱箱金额
     */
    private BigDecimal money;

    /**
     * 小票打印机id
     */
    @TableField("RECEIPT_PRINTER_ID")
    private String receiptPrinterId;

    /**
     * 贴纸打印机id
     */
    @TableField("STICKER_PRINTER_ID")
    private String stickerPrinterId;

    @EntityMapper
    @ManyToOne
    @JoinColumn(name = "receipt_printer_id", referencedColumnName = "ID")
    private transient SystemPrinter receiptPrinter;


    @TableField(exist = false)
    @ManyToOne
    @EntityMapper
    @JoinColumn(name = "sticker_printer_id", referencedColumnName = "id")
    private transient SystemPrinter stickerPrinter;

    @TableField(exist = false)
    private String projectCode;
    @TableField(exist = false)
    private String restaurantCode;


}
